<?php
require '../data/data.php';

session_start();

$isLogin = isset($_SESSION['user']) ? false : true;
if ($isLogin) {
	header('Location:../../public/index.php');
	return;
}
if (isset($_GET['id'])) {
	$id = $_GET['id'];
	$sql = 'update `messages` set like_num = like_num + 1 where id = ?';
	execute($sql, [$id]);
}
header('Location:../../public/index.php');